const express = require("express");
const moment = require("moment");
const contentListM = require("./modules/Db/collections/contentList");
const app = express();
app.post("/weibo",async (req,res)=>{
	const {context} = req.body;
	contentListM.insertOne({
		context,
		addTime:moment().format("YYYY-MM-DD hh:mm:ss")
	}).then(()=>{
		res.json({
			ok:1,
			msg:"添加成功"
		})
	}).catch((err)=>{
		console.log(err);
		res.json({
			ok:1,
			msg:"添加失败，稍后再试"
		})
	})
})
app.get("/weibo",(req,res)=>{
	contentListM.find()
})
app.listen(8090,()=>{
	console.log("success");
})